WPS Office.apk(点击下载) / gag.java


package defpackage;

import android.text.TextUtils;
import cn.wps.moffice.OfficeApp;
import cn.wps.moffice.main.info.DeviceInfo;
import cn.wps.shareplay.message.Message;
import cn.wps.util.JSONUtil;
import com.appsflyer.share.Constants;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.mopub.common.AdType;
import defpackage.fyz;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/* renamed from: gag  reason: default package */
public final class gag {
    public static final String TAG = null;

    /* access modifiers changed from: package-private */
    /* renamed from: gag$a */
    public static class a implements fyv {
        @SerializedName("app_version")
        @Expose
        String app_version = "";
        @SerializedName("app_id")
        @Expose
        String cIv = "";
        @SerializedName("carrier_country_code")
        @Expose
        private String carrier_country_code = "";
        @SerializedName("device_type")
        @Expose
        String device_type = "";
        @SerializedName("timestamp")
        @Expose
        String gNA = "";
        @SerializedName("verifier")
        @Expose
        String gNB = "";
        @SerializedName("mac_address")
        @Expose
        String gNC = "";
        @SerializedName("sdk_type")
        @Expose
        String gND = "";
        @SerializedName("publisher_user_id")
        @Expose
        String gNE = "";
        @SerializedName("os_version")
        @Expose
        String gNF = "";
        @SerializedName("currency_id")
        @Expose
        private String gNG = "";
        @SerializedName("country_code")
        @Expose
        String gNH = "";
        @SerializedName("language_code")
        @Expose
        String gNI = "";
        @SerializedName("mobile_country_code")
        @Expose
        String gNJ = "";
        @SerializedName("screen_density")
        @Expose
        String gNK = "";
        @SerializedName("screen_layout_size")
        @Expose
        String gNL = "";
        @SerializedName("connection_type")
        @Expose
        String gNM = "";
        @SerializedName("secret_key")
        @Expose
        String gNN = "NSQoW3iitEIRVVBSG7qo";
        @SerializedName("UDID")
        @Expose
        String gNx = "";
        @SerializedName(Constants.URL_ADVERTISING_ID)
        @Expose
        String gNy = "";
        @SerializedName("library_version")
        @Expose
        String gNz = "";
        @SerializedName(AdType.STATIC_NATIVE)
        @Expose
        String json = "";
        @SerializedName("platform")
        @Expose
        String platform = "";

        private a() {
        }

        public static a bKF() {
            return new a();
        }
    }

    public static String bKE() throws IOException {
        int i = 0;
        DeviceInfo deviceInfo = new DeviceInfo();
        deviceInfo.dh(OfficeApp.arx().getApplicationContext());
        String c = fyz.xj(fyz.a.gIZ).c(fva.PUSH_HOME_GOOGLE_AD_ID, "");
        int i2 = 0;
        while (TextUtils.isEmpty(c)) {
            c = fyz.xj(fyz.a.gIZ).c(fva.PUSH_HOME_GOOGLE_AD_ID, "");
            try {
                Thread.sleep(1000);
                if (i2 >= 5) {
                    break;
                }
                i2++;
            } catch (InterruptedException e) {
                e.printStackTrace();
                if (i2 >= 5) {
                    break;
                }
                i2++;
            } catch (Throwable th) {
                if (i2 < 5) {
                    throw th;
                }
            }
        }
        String str = "";
        while (TextUtils.isEmpty(str)) {
            if (ebo.arU()) {
                OfficeApp.arx().getApplicationContext();
                str = ebo.aSr().getUserId();
            }
            try {
                Thread.sleep(1000);
                if (i >= 5) {
                    break;
                }
                i++;
            } catch (InterruptedException e2) {
                e2.printStackTrace();
                if (i >= 5) {
                    break;
                }
                i++;
            } catch (Throwable th2) {
                if (i < 5) {
                    throw th2;
                }
            }
        }
        long currentTimeMillis = System.currentTimeMillis();
        a bKF = a.bKF();
        bKF.cIv = "7465a9ab-338c-495c-a1f0-c3c6cf39424e";
        bKF.device_type = "android";
        bKF.gNF = deviceInfo.app_version;
        bKF.gNH = deviceInfo.country;
        bKF.gNx = "";
        if (bKF.gNx == null || TextUtils.isEmpty(bKF.gNx)) {
            bKF.gNx = new StringBuilder().append(System.currentTimeMillis()).toString();
        }
        bKF.gNy = c;
        bKF.gNI = deviceInfo.lang;
        bKF.app_version = deviceInfo.app_version;
        bKF.gNz = "server";
        deviceInfo.getClass();
        bKF.platform = "android";
        bKF.gNJ = deviceInfo.mcc;
        bKF.gNK = new StringBuilder().append(deviceInfo.dip).toString();
        bKF.gNL = new StringBuilder().append(deviceInfo.device_screen_size).toString();
        bKF.gNM = deviceInfo.network_type;
        bKF.gNA = new StringBuilder().append(currentTimeMillis).toString();
        bKF.gNE = str;
        bKF.gND = "offers";
        bKF.json = "1";
        bKF.gNC = deviceInfo.mac;
        bKF.gNB = "";
        if (TextUtils.isEmpty("")) {
            bKF.gNB = uK(bKF.cIv + Message.SEPARATE2 + bKF.gNy + Message.SEPARATE2 + bKF.gNA + Message.SEPARATE2 + bKF.gNN);
        }
        return lwd.c("https://movip.wps.com/template/tapjoy/pullAds", "requestBody=" + JSONUtil.getGson().toJson(bKF), null);
    }

    public static String uK(String str) {
        byte[] bytes = str.getBytes();
        try {
            MessageDigest instance = MessageDigest.getInstance("SHA-256");
            instance.update(bytes);
            byte[] digest = instance.digest();
            String str2 = "";
            int i = 0;
            while (i < digest.length) {
                String hexString = Integer.toHexString(digest[i] & 255);
                if (hexString.length() == 1) {
                    str2 = str2 + "0";
                }
                i++;
                str2 = str2 + hexString;
            }
            return str2;
        } catch (NoSuchAlgorithmException e) {
            return null;
        }
    }
}